package com.studyv3.test.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 对象存储表
 * @TableName res_resource
 */
@TableName(value ="lb_resource")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Resource implements Serializable {
    /**
     * 主键，序号
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 大小
     */
    private Long size;

    /**
     * 桶
     */
    private String bucket;

    /**
     * 对象名
     */
    private String objName;

    /**
     * 对象类型:1.图片 2.视频 3.ppt 4.pdf
     */
    private String contentType;

    /**
     * 创建时间
     */
    private Date ctime;

    /**
     * 访问地址
     */
    private String url;

    public Resource(Long size, String bucket, String objName, String contentType, String url) {
        this.size = size;
        this.bucket = bucket;
        this.objName = objName;
        this.contentType = contentType;
        this.url = url;
        this.ctime=new Date();
    }

}